日常学习记录——openpyxl保存操作
锂盐块呀:
我刚刚试了一下这个博客的内容,博客地址:https://blog.csdn.net/u010229047/article/details/104483120,可以读取出复选框的值,您可以参考一下,我的代码为:
# win32com
excel = gencache.EnsureDispatch('Excel.Application')
excel.DisplayAlerts = False
wbtest = excel.Workbooks.Open(r"E:\My Word\study\界面demo\watermelon.xlsx")
wstest = wbtest.Worksheets('Sheet1')
print('Shape count: %s' % len(wstest.Shapes))
for shape in wstest.Shapes:
if shape.Type == 8: # form control
if 'Check Box' in shape.Name:
print('%s: %s' % (shape.AlternativeText, shape.ControlFormat.Value))
输出提示:
Shape count: 1
复选框 1: -4146
|